Skip to content

fix(UI):Module import configuration#1178

Merged
benjamin-747 merged 2 commits into
gitmono-dev:mainfrom
Ceron-CSS:main
Jul 1, 2025
Merged

fix(UI):Module import configuration#1178
benjamin-747 merged 2 commits into
gitmono-dev:mainfrom
Ceron-CSS:main

Conversation

@Ceron-CSS

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Jul 1, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mega ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2025 9:45am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the import of UnderlinePanels from the Primer React experimental package and adds logic to close the editor bubble menu when clicking outside it.

  • Destructure UnderlinePanels via require instead of assigning the entire module.
  • Introduce a useEffect hook in EditorBubbleMenu to handle outside clicks and blur the editor.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
moon/apps/web/pages/[org]/mr/[id].tsx Updated module import to destructure UnderlinePanels from the experimental package.
moon/apps/web/components/EditorBubbleMenu/EditorBubbleMenu.tsx Added an effect that listens for outside clicks to clear selection and hide the bubble menu.
Comments suppressed due to low confidence (1)

moon/apps/web/components/EditorBubbleMenu/EditorBubbleMenu.tsx:149

  • [nitpick] Add unit or integration tests for the outside-click behavior to ensure the bubble menu reliably hides when clicking outside the editor area.
  useEffect(() => {

const { data: MrDetailData, isLoading: detailIsLoading } = useGetMrDetail(id)
const mrDetail = MrDetailData?.data as MRDetail | undefined
const UnderlinePanels = require('@primer/react/experimental')
const { UnderlinePanels } = require('@primer/react/experimental')

Copilot AI Jul 1, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving this import to a static top-level import { UnderlinePanels } from '@primer/react/experimental' to avoid requiring the module on each render and improve readability.

Suggested change
const { UnderlinePanels } = require('@primer/react/experimental')
// Removed dynamic import of UnderlinePanels

Copilot uses AI. Check for mistakes.
return
}

const handleClickOutside = (event: Event) => {

Copilot AI Jul 1, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Extract the outside-click logic into a reusable custom hook (e.g., useClickOutside) to reduce boilerplate and improve maintainability across components.

Copilot uses AI. Check for mistakes.
@benjamin-747
benjamin-747 added this pull request to the merge queue Jul 1, 2025
Merged via the queue into gitmono-dev:main with commit 7a97d32 Jul 1, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants